Skip to main content

Disk Benchmark

Disk Benchmark / Performance / Speed

Write speed

dd 
if=/dev/zero
of=<file>
bs=<size>[K|M|G]
count=<count>[K|M|G]
{ conv=fsync | oflag={sync|dsync|direct} }
OptionDescription
conv=fsyncSynchronize before finishing
dsyncSynchronized I/O for data
syncSynchronized I/O for data and meta data
directDirect I/O
dd if=/dev/zero of=temp bs=1M count=1K oflag=direct; rm temp

Read speed

Using dd iflag=direct

dd
if=<file>
of=/dev/null
bs=<size>[<unit>]
[count=<count>[<unit>]]
iflag=direct
dd if=/dev/sda1 of=/dev/null bs=1M count=1K iflag=direct
UnitDescription
c1
w2
b512
kB1000
K1024
MB1000²
M1024²
GB1000³
G1024³
T1024⁴
P1024⁵
E1024⁶
Z1024⁷
Y1024⁸

Using drop_caches

# Synchronize cached writes to persistent storage
sync

# Free cache
echo 3 > /proc/sys/vm/drop_caches

dd if=<file> of=/dev/null bs=<size>[K|M|G] [count=<count>[K|M|G]]

drop_caches doc


Read speed test without prior cache

hdparm -t /dev/<device>

Read speed test with buffer

hdparm -T /dev/<device>